package com.qf.j2205.util;


import com.qf.j2205.entity.Screenings;
import com.qf.j2205.entity.vo.ScreeningsVo;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName SrcUtil
 * @Description TODO
 * @Author Windy
 * @Date 2022/8/16 14:33
 * @Version 1.0
 **/
public class SrcUtil {
    public static List<ScreeningsVo> ScreeningsToVos(List<Screenings> lists){
        List<ScreeningsVo> vos=new ArrayList<>();
        for (Screenings list : lists) {
            ScreeningsVo vo = ScreeningsToVo(list);
            vos.add(vo);
        }
        return vos;

    }

    public static ScreeningsVo ScreeningsToVo(Screenings list){
        ScreeningsVo vo = new ScreeningsVo();
        vo.setScid(list.getScid());
        vo.setOpenDate(new SimpleDateFormat("yyyy-MM-dd").format(list.getOpenDate()));
        vo.setMaxCapacity(list.getMaxCapacity());
        vo.setNetOrder(list.getNetOrder());
        vo.setOpenTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(list.getOpenTime()).split(" ")[1]);
        vo.setCloseTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(list.getCloseTime()).split(" ")[1]);
        vo.setIsaudit(list.getIsaudit());
        return vo;
    }
}
